from flask import Flask, make_response, request, session
import datetime
import os
app = Flask(__name__)
#  启用session
app.config['SECRET_KEY'] = os.urandom(24)  # 生成随机数种子，用于生成sessionId

from controller.user import user
# 注册蓝图
app.register_blueprint(user)

from controller.article import article
app.register_blueprint(article)

# 定制页面的错误处理
@app.errorhandler(404)
def page_not_found(error):
    print(error)
    return "输入的网址错误"

@app.errorhandler(500)
def service_error(error):
    print(error)
    return "服务端出错啦"


if __name__ == "__main__":
    app.run()
